package com.weido;

import com.alibaba.fastjson.JSONObject;
import com.weido.domain.Role;
import com.weido.domain.User;

public class Test {
    public static void main(String[] args) {
        User u=new User();
        u.setUsername("sss");
        u.setAge(1);
        Role r= new Role();
        r.setUser(u);
        r.setName("hh");
        JSONObject jsonObject= (JSONObject) JSONObject.toJSON(r);
        Object user = jsonObject.get("name");
        System.out.println(user.getClass());

    }
}
